<?php
//No direct access
defined('_JEXEC') or die('Restricted access');
?>
<div id="ownservices">
 <div id="mainmenuownservice"><?php echo MenuHelper::nav(); ?></div>
	<div id="mainownservice">
		<h3><?php echo JText::_('OWNSERVICE_TRANSFERRED_RECORD_USER'); ?></h3>
		<hr />
		<script language="javascript" type="text/javascript">
			<!--
				function submitbutton(pressbutton)
				{
					var form = document.adminForm;
					if(form.user_id.value == '') {
						alert( "<?php echo JText::_( 'OWNSERVICE_PLEASE_SELECT_USER', true ); ?>" );
						return false;
					}
					if(form.period[0].checked) {
						if(form.date.value == "") {
							alert( "<?php echo JText::_( 'OWNSERVICE_PLEASE_SELECT_DAY', true ); ?>" );
							return false;
						}
					} else if(form.period[1].checked) {
						if(form.month.value == "") {
							alert( "<?php echo JText::_( 'OWNSERVICE_PLEASE_SELECT_MONTH', true ); ?>" );
							return false;
						}
					} else if(form.period[2].checked) {
						if(form.from.value == "") {
							alert( "<?php echo JText::_( 'OWNSERVICE_PLEASE_SELECT_FROM', true ); ?>" );
							return false;
						} else if(form.to.value == "") {
							alert( "<?php echo JText::_( 'OWNSERVICE_PLEASE_SELECT_TO', true ); ?>" );
							return false;
						}
					} else {
						alert( "<?php echo JText::_( 'OWNSERVICE_PLEASE_SELECT_PERIOD', true ); ?>" );
						return;
					}
					submitform( pressbutton );
				}
			//-->
		</script>
		<form action="<?php echo JRoute::_('index.php?option=com_ownservice'); ?>" method="post" name="adminForm">
		<table class="admintable">
			<tr>
				<td class="key"><?php echo JText::_('OWNSERVICE_PLEASE_SELECT_USER'); ?></td>
				<td>
					<?php //echo $this->lists['user']; ?>
					<table>
						<tr>
							<td style="margin: 0; padding: 0;">
								<input type="text" name="membername" id="membername" value="" class="inputbox" style="width:250px;" />
							</td>
							<td>
								<div class="button2-left">
									<div class="blank">
										<a class="modal" title="<?php echo JText::_('OWNS_SELECT_SENDER'); ?>" href="index.php?option=com_ownservice&amp;view=userselement&amp;tmpl=component" rel="{handler: 'iframe', size: {x:window.getSize().scrollSize.x-100, y: window.getSize().size.y-100}}">
											<?php echo JText::_('OWNS_SELECT_SENDER'); ?>
										</a>
									</div>
								</div>
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td class="key"><?php echo JText::_('OWNSERVICE_SELECT_PERIOD'); ?></td>
				<td>
					<input type="radio" name="period" id="pday" value="1" class="inputbox" checked="checked" /> 
					<?php echo JText::_('OWNSERVICE_DAY');?> 
					<?php echo JHTML::_('calendar', date('Y-m-d'), 'date', 'date', '%Y-%m-%d',array('class'=>'inputbox')); ?>
				</td>
			</tr>
			<tr>
				<td></td>
				<td>
					<input type="radio" name="period" id="pmonth" value="2" class="inputbox" /> <?php echo JText::_('OWNSERVICE_MONTH');?>
					<select name="month" id="mouth" class="inputbox">
						<option value=""><?php echo JText::_('OWNSERVICE_PLEASE_SELECT'); ?></option>
						<option value="01"><?php echo JText::_('OWNSERVICE_JANUARY'); ?></option>
						<option value="02"><?php echo JText::_('OWNSERVICE_FEBRUARY'); ?></option>
						<option value="03"><?php echo JText::_('OWNSERVICE_MARCH'); ?></option>
						<option value="04"><?php echo JText::_('OWNSERVICE_APRIL'); ?></option>
						<option value="05"><?php echo JText::_('OWNSERVICE_MAY'); ?></option>
						<option value="06"><?php echo JText::_('OWNSERVICE_JUNE'); ?></option>
						<option value="07"><?php echo JText::_('OWNSERVICE_JULY'); ?></option>
						<option value="08"><?php echo JText::_('OWNSERVICE_AUGUST'); ?></option>
						<option value="09"><?php echo JText::_('OWNSERVICE_SEPTEMBER'); ?></option>
						<option value="10"><?php echo JText::_('OWNSERVICE_OCTOBER'); ?></option>
						<option value="11"><?php echo JText::_('OWNSERVICE_NOVEMBER'); ?></option>
						<option value="12"><?php echo JText::_('OWNSERVICE_DECEMBER'); ?></option>
					</select>
				 </td>
			</tr>
			<tr>
				<td></td>
				<td>
					<input type="radio" name="period" id="pform" value="3" class="inputbox" /> 
					<?php echo JText::_('OWNSERVICE_FROM');?> <?php echo JHTML::_('calendar','', 'from', 'from', '%Y-%m-%d',array('class'=>'inputbox')); ?> 
					<?php echo JText::_('OWNSERVICE_TO'); ?> <?php echo JHTML::_('calendar','', 'to', 'to', '%Y-%m-%d',array('class'=>'inputbox')); ?>
				</td>
			</tr>
			<tr>
				<td colspan="2" align="center">
					<input type="button" name="next" value="<?php echo JText::_('OWNSERVICE_REPORTS'); ?>" onClick="javascript: submitbutton('transferredUser');" />
				</td>
			</tr>
		</table>
		
		<input type="hidden" name="option" value="com_ownservice" />
		<input type="hidden" name="user_id" id="user_id" value="" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="Itemid" value="<?php echo JRequest::getVar('Itemid'); ?>" />
		<input type="hidden" name="controller" value="report" />
		<input type="hidden" name="view" value="report" />
		<?php echo JHTML::_( 'form.token' ); ?>
		</form>
	</div>
</div>